#include "StdAfx.h"

#include "POP3Client.h"

#define WIN32_LEAN_AND_MEAN
#define _HAS_EXCEPTIONS 1
#include <windows.h>

#include <stdlib.h>
#include <stdio.h>
#include "conio.h"

#include <cctype>

#include <typeinfo>
using namespace std;

// Need to link with Ws2_32.lib, Mswsock.lib, and Advapi32.lib
#pragma comment (lib, "Ws2_32.lib")
#pragma comment (lib, "Mswsock.lib")
#pragma comment (lib, "AdvApi32.lib")

#define DEFAULT_BUFLEN 512
#define DEFAULT_PORT "25"

namespace libdmail
{

	POP3Client::POP3Client()
	{
		this->mUser = "";
		this->mPass = "";
		this->mPop3 = new POP3();
	}

	POP3Client::POP3Client(string user, string pass)
	{
		this->mUser = user;
		this->mPass = pass;
		this->mPop3 = new POP3();
	}

	POP3Client::~POP3Client(void)
	{
	}

	int POP3Client::getMailFromPOP3(string pop3Server, string pop3Port, string user, string pass)
	{
		this->mUser = user;
		this->mPass = pass;

		this->mPop3->connectPOP3Server(pop3Server, pop3Port, this->mUser, this->mPass);

		return 0;
	}

}